


#ifndef _SOCKET_TCPIP_H
#define	_SOCKET_TCPIP_H

#include "../base/Socket_Base.h"

struct Socket_TCPIP_Info
{
    // listen port
    int port;
    // socket buffer length
    int queueLength;
    // fd
    int fd;
    //
    struct sockaddr_in *addr_in;
    //
    socklen_t len;
    // configure sockaddr_in
    int configSocketAddr();
    // configure socketlen_t
    int configSocketLen();
    // construction
    Socket_TCPIP_Info(int a_nPort, int a_nQueuelength);
};

class Socket_TCPIP : public Socket_Base
{
public:
    int socket_bind();
    
    int socket_listen();
    
    /**
     * 带配置文件的构造函数
     */
    Socket_TCPIP(struct Socket_TCPIP_Info *a_sInfo);
    Socket_TCPIP(int a_nPort);
    Socket_TCPIP();
    /**
     * use to make outside can control this class
     */
    struct Socket_TCPIP_Info *m_sInfo;
};




#endif